# Contributor: Alexander Sack <asac@pantacor.com>
# Maintainer: Alexander Sack <asac@pantacor.com>
pkgname=tpm2-tools
pkgver=5.2
pkgrel=1
pkgdesc="TPM2 Tools"
url="https://github.com/tpm2-software/tpm2-tools/"
arch="all"
license="BSD-2-Clause"
makedepends="tpm2-tss-dev openssl1.1-compat-dev curl-dev util-linux-dev libtool
	autoconf automake"
subpackages="$pkgname-bash-completion"
source="https://github.com/tpm2-software/tpm2-tools/releases/download/$pkgver/tpm2-tools-$pkgver.tar.gz
	dont-generate-manpages-without-pandoc.patch
	char16_t.patch
	"
options="!check"

prepare() {
	default_prepare

	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
9fb5dc298717a8a57c89d286e3590370a096c81b14d2d8d4eb5fca140d66148a8e24727ee04fb02057bbfcc3ede50e93ba0ef22396888c9df48bf6f42a5d6e6b  tpm2-tools-5.2.tar.gz
2e0862c3c5d07cd40f655fa762a881a243fcf63c966f9867032057f7d7373fea94785929d8ef8bba8961bafa7d4549ebb3b90a09b15d6cfd8d3f08acfd488364  dont-generate-manpages-without-pandoc.patch
a88ad5447a0f7b6f2e591a90376a699b5ea4f1b16b66a86ec7c5f196b239b7be73f6090e4181d36c9d7c12487532e86b7265c7c3f534fb1a57c55d3fb2fec12a  char16_t.patch
"
